<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
	<link rel="stylesheet" href="css/information.css">
	<link rel="stylesheet" href="css/remove.css">
</head>
<body>
	<header>
		<div class="header-top">
			<div class="header-top-con">
				<ul>
					<li><a href="order.html">
						订单追踪
						<i class="icon-headerf icon-new-first"></i>
					</a></li>
					<li><a href="">
						帮助中心
						<i class="icon-headers icon-new-second"></i>
					</a></li>
					<li><a href="">
						在线客服
						<i class="icon-headert icon-new-third"></i>
					</a></li>
					<li><a class="user" href="sign.html">
						登录
						<i id="login" class="icon-headerl icon-new-last"></i>
					</a></li>
					<div id="hover">
						<p class="qie">切换账户</p>
						<p class="me">个人信息</p>
						<p class="tui">退出</p>
					</div>
				</ul>
			</div>
		</div>
		<div class="header-con">
			<div class="header-con-left">
				<h1>
					<img src="img/first/logo-new.png" alt="">
				</h1>
				<ul>
					<li><a href="list.html">男子</a></li>
					<li><a href="">女子</a></li>
					<li><a href="">儿童</a></li>
					<li><a href="">|</a></li>
					<li><a href="">运动</a></li>
					<li><a href="">品牌</a></li>
					<li><a href="">精选系列</a></li>
				</ul>
			</div>
			<ul class="header-con-right">
				<li class="header-seach">
					<i></i>
					<input type="" placeholder="冬季甄选">
				</li>
				<li class="car">
					<i class="icon-cart"></i>
					<span class="icon-car">0</span>
				</li>
			</ul>
		</div>
	</header>
	<article>
		<div class="con-article">
			<span class="icon-new icon-usp"></span>
			<p class="usp1">全场免运费</p>
			<span class="icon-new icon-time"></span>
			<p>尊享当日达、次日达、次晨达</p>
		</div>
		<hr>
		<div class="con-article1">
			<ul class="list-inline">
				<li>返回</li>
				<li>|</li>
				<li>首页
					<span></span>
				</li>
				<li>男子商品</li>
				<li class="infortitele"></li>
			</ul>
		</div>
		<div class="banner">
			<div class="banner-con">
				<img alt="">
				<div class="message">
					<div class="good-git">
					</div>
					<h3></h3>
					<div class="start-box">
						<i class="icon-new icon-start"></i>
						共997条评价
					</div>
					<div class="mes-price">
					</div>
					<ul class="style"> 
						<li>
							<p>灰色</p>
							<span>√</span>
						</li>
						<li>
							<p>红黑</p>
							<span>√</span>
						</li>
						<li>
							<p>黑色</p>
							<span>√</span>
						</li>
						<li>
							<p>红荧光</p>
							<span>√</span>
						</li>
						<li>
							<p>亮白</p>
							<span>√</span>
						</li>
						<li>
							<p>荣蓝</p>
							<span>√</span>
						</li>
					</ul>
					<p class="size">查看尺码对照表</p>
					<p class="size-da">
						<span>选则尺码</span>
					</p>
					<ul class="size-shu">
						<li>36</li>
						<li>37</li>
						<li>38</li>
						<li>39</li>
						<li>40</li>
						<li>41</li>
						<li>42</li>
						<li>43</li>
						<li>44</li>
						<li>45</li>
					</ul>
					<div class="gm">
						<div class="mai">
							立即购买
						</div>
						<div class="shopping">
							加入购物袋
						</div>
					</div>
				</div>
			</div>
		</div>	
		<div class="miaoshu">
			<h3>商品描述</h3>
			<p class="miaoshu-wenzi">
				
			</p>
		</div>			
	</article>
	

	<div class="footer-top">
		<div class="footer-top-con">
			<ul>
				<li>联系我们</li>
				<li>
					<i class="icon icon-ke"></i>
					在线客服
				</li>
				<li>
					<i class="icon icon-phone"></i>
					400-999-5999
				</li>
				<li>
					<i class="icon icon-email"></i>
					server@adidas.com
				</li>
				<li>
					<i class="icon icon-time"></i>
					9:00-22:00
				</li>
			</ul>
			<div class="right">
				<i class="icon icon-zhui"></i>
				订单追踪
			</div>
		</div>
	</div>
	<div class="footer-con">
		<ul>
			<ul>
				<li class="foot-procuct">产品</li>
				<li>鞋类</li>
				<li>服装</li>
				<li>配件</li>
				<li>最新上市</li>
				<li>新品发售日历</li>
				<li>限量发售</li>
			</ul>
			<ul>
				<li class="foot-procuct">运动</li>
				<li>跑步</li>
				<li>训练</li>
				<li>足球</li>
				<li>篮球</li>
				<li>户外</li>
			</ul>
			<ul>
				<li class="foot-procuct">帮助中心</li>
				<li>关于员工</li>
				<li>尺码表</li>
				<li>adiCLUB会员</li>
				<li>门店查询</li>
				<li>关于我们</li>
				<li>企业社会责任</li>
				<li>ADIDAS APP</li>
			</ul>
			<ul>
				<li class="foot-procuct">网站政策</li>
				<li>使用条款</li>
				<li>隐私声明</li>
				<li>物流配送规则</li>
				<li>退换货规则</li>
				<li>adiCLUB会员规则</li>
				<li>下单指南</li>
				<li>印制服务条款</li>
			</ul>
		</ul>
		<div class="right">
			<p class="foot-procuct">关注我们</p>
			<span class="icon-span span1"></span>
			<span class="icon-span span2"></span>
		</div>
		<div class="right">
			<p class="foot-procuct">职业发展</p>
			<span class="icon-span span3"></span>
		</div>
	</div>
	<ul class="footer-method">
		<li>我们接受下列付款方式：</li>
		<li class="icon icon-zhi"></li>
		<li class="icon icon-wei"></li>
		<li class="icon icon-yin"></li>
	</ul>
	<div class="text">
		<p>企业团购热线及邮箱：&nbsp;&nbsp;&nbsp;团购热线：021-2525 6861</p>
		<p>团购邮箱：adidas.com  (仅限采购金额10万以上)</p>
	</div>
	<div class="footer-bot">
		<div class="footer-bot-con">
			<p class="p1">
				<span class="icon icon-china"></span>
				<span>中国</span>
				<span>隐私声明</span>
				<span>使用条款</span>
				<span>网站地图</span>
				<span>&copy;阿迪达斯体育(中国)有限公司保留所有权利</span>
			</p>
			<p class="p2">
				<span>苏ICP备14048805号-1</span><span class="icon icon-hui"></span><span>&copy;2019adidas江苏工商</span><span class="icon icon-hui"></span><span>苏公安网安备32059002001401号</span>
			</p>
		</div>
	</div>				
</body>
<script src="js/jquery.min.js"></script>
<script src="js/remove.js"></script>
<script>
	let result = 0;
	$(".icon-car").html(result);
	let liList = document.querySelectorAll(".style li");
	$(".style li").click(function(){
		for(let i = 0; i < liList.length; i++){
			liList[i].querySelector("span").className = "";
			this.querySelector("span").className = "dui";
		}	
	})
	
	$(".size-da").click(function(){
		$(".size-shu").css("display","block");
		$(".size-shu li").click(function(){
			$(".size-da span").html($(this).html());
			$(".size-shu").css("display","none");
		})
	})
	$.ajax({
		url:`http://10.35.164.241:8080/information`,
		data:{
			id:sessionStorage.getItem("list-id"),
		},
		success:function(data){
			let newList = (JSON.parse(data));
			newList.forEach(function(item){
				$(".infortitele").html(item.product);
				$(".good-git").html(item.style);
				$(".message>h3").html(item.product);
				$(".banner-con img").attr("src","img/list/"+item.src);
				$(".miaoshu-wenzi").html(item.infor);
				$(".mes-price").html(item.price);
			})
		}
	})

	$(".shopping").click(function(){
		if($(".size-da span").html() == "选则尺码") {
			alert("请选择尺码");
			return;
		}
		else if(sessionStorage.getItem("showusername")) {
			let username = sessionStorage.getItem("showusername");
			let title = $(".message>h3").html();
			let color = $(".dui").closest("li").find("p").html();
			let size = $(".size-da span").html();
			let listId = sessionStorage.getItem("list-id");
			let price = $(".mes-price").html();
			let src = $(".banner-con img").attr("src");
			$.ajax({
				url:"http://10.35.164.241:8080/insertCar",
				data:{
					username:username,
					title:title,
					color:color,
					size:size,
					listId:listId,
					price:price,
					src:src,
				},
				success:function(data){
					if (data === "success") {
						alert("加入购物车");
						$.ajax({
							url:"http://10.35.164.241:8080/selectUserCar",
							data:{
								username:username,
							},
							success:function(data){
								$(".icon-car").html(JSON.parse(data).length);
							}
						})
					}
				}
			})
		}
		else{
			location.href = "http://10.35.164.241:8080/sign.html"
		}
	})


	//立即购买功能
	$(".mai").click(function(){
		let username = sessionStorage.getItem("showusername");
		if (username) {
			let productmation = {
				title:$(".message>h3").html(),
				price:$(".mes-price").html(),
				color:$(".dui").closest("li").find("p").html(),
				size:$(".size-da>span").html(),
				src:$(".banner-con img").attr("src"),
				listId:sessionStorage.getItem("list-id"),
			}

			sessionStorage.setItem("mation",JSON.stringify(productmation));
			sessionStorage.setItem("state","false");
			location.href = "http://10.35.164.241:8080/submit.html"
		}
		else{
			location.href = "http://10.35.164.241:8080/sign.html";
		}
	})
</script>
</html>
